import { handleActions } from "redux-actions";
import Immutable from "seamless-immutable";
import * as type from "../types/account";

export const defaultState = Immutable({
  info: {}
});

export default handleActions(
  {
    [type.ACCOUNT_GET_SELF_SUCCESS]: (state, { payload }) => {
      return state.merge(
        {
          info: payload
        },
        { deep: true }
      );
    }
  },
  defaultState
);
